import {
  SetMetadata,
  createParamDecorator,
  ExecutionContext,
  applyDecorators,
} from '@nestjs/common';
import type { Request } from 'express';
export const Role = (role: string[]) => {
  console.log('role==1111', role, 1);
  console.log('role==2222', role, 1);

  return SetMetadata('role', role);
};

export const ReqUrl = createParamDecorator(
  (data: string, ctx: ExecutionContext) => {
    const req = ctx.switchToHttp().getRequest<Request>();
    return req.url;
  },
);
